package org.example.functionInterface;

import java.util.function.Predicate;

public class Demo13Predicate {
    //“与”、“或”已经了解了，剩下的“非”（取反）也会简单
    private static void method(Predicate<String> predicate, String str) {
        boolean veryLong = predicate.negate().test(str);
        System.out.println("字符串很长吗：" + veryLong);
    }

    public static void main(String[] args) {
        method(s -> s.length() < 5, "Helloworld");
    }
}